/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bkt.service.model.hr.leave.impl;

import bkt.model.hr.leave.MaternityLeave;
import bkt.repository.jpa.GenericDAO;
import bkt.service.model.hr.leave.MaternityLeaveService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author hashcode
 */
@Service("maternityLeaveService")
public class MaternityLeaveServiceImpl implements MaternityLeaveService {

    @Autowired
    private GenericDAO< MaternityLeave> dao;
    public final void setDao(final GenericDAO< MaternityLeave> daoToSet) {
        this.dao = daoToSet;
        this.dao.setClazz(MaternityLeave.class);
    }
    public MaternityLeaveServiceImpl() {
    }

    @Override
    public MaternityLeave findById(String id) {
        setDao(dao);
        return dao.findById(id);
    }

    @Override
    public List<MaternityLeave> findAll() {
        setDao(dao);
        return dao.findAll();
    }

    @Override
    public void persist(MaternityLeave entity) {
        setDao(dao);
        dao.persist(entity);
    }

    @Override
    public void merge(MaternityLeave entity) {
        setDao(dao);
        dao.merge(entity);
    }

    @Override
    public void remove(MaternityLeave entity) {
        setDao(dao);
        dao.remove(entity);
    }

    @Override
    public void removeById(String entityId) {
        setDao(dao);
        MaternityLeave v = dao.findById(entityId);
        dao.remove(v);
    }

    @Override
    public List<MaternityLeave> findInRange(int firstResult, int maxResults) {
        setDao(dao);
        return dao.findInRange(firstResult, maxResults);
    }

    @Override
    public long count() {
        setDao(dao);
        return dao.count();
    }

    @Override
    public MaternityLeave getByPropertyName(String name, String value) {
        setDao(dao);
        return dao.getByPropertyName(name, value);
    }

    @Override
    public List<MaternityLeave> getEntitiesByProperName(String name, String value) {
        setDao(dao);
        return dao.getEntitiesByProperName(name, value);
    }

   
}